home *** CD-ROM | disk | FTP | other *** search
- package java.lang;
-
- import java.io.BufferedInputStream;
- import java.io.BufferedOutputStream;
- import java.io.Console;
- import java.io.FileDescriptor;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.PrintStream;
- import java.nio.channels.Channel;
- import java.nio.channels.spi.SelectorProvider;
- import java.security.AccessController;
- import java.util.Map;
- import java.util.Properties;
- import java.util.PropertyPermission;
- import sun.misc.SharedSecrets;
- import sun.misc.VM;
- import sun.misc.Version;
- import sun.net.InetAddressCachePolicy;
- import sun.reflect.Reflection;
-
- public final class System {
- // $FF: renamed from: in java.io.InputStream
- public static final InputStream field_0;
- public static final PrintStream out;
- public static final PrintStream err;
- private static volatile SecurityManager security;
- private static volatile Console cons;
- private static Properties props;
-
- private static native void registerNatives();
-
- private System() {
- }
-
- public static void setIn(InputStream var0) {
- checkIO();
- setIn0(var0);
- }
-
- public static void setOut(PrintStream var0) {
- checkIO();
- setOut0(var0);
- }
-
- public static void setErr(PrintStream var0) {
- checkIO();
- setErr0(var0);
- }
-
- public static Console console() {
- if (cons == null) {
- synchronized(System.class) {
- cons = SharedSecrets.getJavaIOAccess().console();
- }
- }
-
- return cons;
- }
-
- public static Channel inheritedChannel() throws IOException {
- return SelectorProvider.provider().inheritedChannel();
- }
-
- private static void checkIO() {
- SecurityManager var0 = getSecurityManager();
- if (var0 != null) {
- var0.checkPermission(new RuntimePermission("setIO"));
- }
-
- }
-
- private static native void setIn0(InputStream var0);
-
- private static native void setOut0(PrintStream var0);
-
- private static native void setErr0(PrintStream var0);
-
- public static void setSecurityManager(SecurityManager var0) {
- try {
- var0.checkPackageAccess("java.lang");
- } catch (Exception var2) {
- }
-
- setSecurityManager0(var0);
- }
-
- private static synchronized void setSecurityManager0(SecurityManager var0) {
- SecurityManager var1 = getSecurityManager();
- if (var1 != null) {
- var1.checkPermission(new RuntimePermission("setSecurityManager"));
- }
-
- if (var0 != null && var0.getClass().getClassLoader() != null) {
- AccessController.doPrivileged(new 1(var0));
- }
-
- security = var0;
- InetAddressCachePolicy.setIfNotSet(-1);
- }
-
- public static SecurityManager getSecurityManager() {
- return security;
- }
-
- public static native long currentTimeMillis();
-
- public static native long nanoTime();
-
- public static native void arraycopy(Object var0, int var1, Object var2, int var3, int var4);
-
- public static native int identityHashCode(Object var0);
-
- private static native Properties initProperties(Properties var0);
-
- public static Properties getProperties() {
- SecurityManager var0 = getSecurityManager();
- if (var0 != null) {
- var0.checkPropertiesAccess();
- }
-
- return props;
- }
-
- public static void setProperties(Properties var0) {
- SecurityManager var1 = getSecurityManager();
- if (var1 != null) {
- var1.checkPropertiesAccess();
- }
-
- if (var0 == null) {
- var0 = new Properties();
- initProperties(var0);
- }
-
- props = var0;
- }
-
- public static String getProperty(String var0) {
- checkKey(var0);
- SecurityManager var1 = getSecurityManager();
- if (var1 != null) {
- var1.checkPropertyAccess(var0);
- }
-
- return props.getProperty(var0);
- }
-
- public static String getProperty(String var0, String var1) {
- checkKey(var0);
- SecurityManager var2 = getSecurityManager();
- if (var2 != null) {
- var2.checkPropertyAccess(var0);
- }
-
- return props.getProperty(var0, var1);
- }
-
- public static String setProperty(String var0, String var1) {
- checkKey(var0);
- SecurityManager var2 = getSecurityManager();
- if (var2 != null) {
- var2.checkPermission(new PropertyPermission(var0, "write"));
- }
-
- return (String)props.setProperty(var0, var1);
- }
-
- public static String clearProperty(String var0) {
- checkKey(var0);
- SecurityManager var1 = getSecurityManager();
- if (var1 != null) {
- var1.checkPermission(new PropertyPermission(var0, "write"));
- }
-
- return (String)props.remove(var0);
- }
-
- private static void checkKey(String var0) {
- if (var0 == null) {
- throw new NullPointerException("key can't be null");
- } else if (var0.equals("")) {
- throw new IllegalArgumentException("key can't be empty");
- }
- }
-
- public static String getenv(String var0) {
- SecurityManager var1 = getSecurityManager();
- if (var1 != null) {
- var1.checkPermission(new RuntimePermission("getenv." + var0));
- }
-
- return ProcessEnvironment.getenv(var0);
- }
-
- public static Map<String, String> getenv() {
- SecurityManager var0 = getSecurityManager();
- if (var0 != null) {
- var0.checkPermission(new RuntimePermission("getenv.*"));
- }
-
- return ProcessEnvironment.getenv();
- }
-
- public static void exit(int var0) {
- Runtime.getRuntime().exit(var0);
- }
-
- // $FF: renamed from: gc () void
- public static void method_0() {
- Runtime.getRuntime().gc();
- }
-
- public static void runFinalization() {
- Runtime.getRuntime().runFinalization();
- }
-
- /** @deprecated */
- @Deprecated
- public static void runFinalizersOnExit(boolean var0) {
- Runtime.getRuntime();
- Runtime.runFinalizersOnExit(var0);
- }
-
- public static void load(String var0) {
- Runtime.getRuntime().load0(getCallerClass(), var0);
- }
-
- public static void loadLibrary(String var0) {
- Runtime.getRuntime().loadLibrary0(getCallerClass(), var0);
- }
-
- public static native String mapLibraryName(String var0);
-
- private static InputStream nullInputStream() throws NullPointerException {
- if (currentTimeMillis() > 0L) {
- return null;
- } else {
- throw new NullPointerException();
- }
- }
-
- private static PrintStream nullPrintStream() throws NullPointerException {
- if (currentTimeMillis() > 0L) {
- return null;
- } else {
- throw new NullPointerException();
- }
- }
-
- private static void initializeSystemClass() {
- props = new Properties();
- initProperties(props);
- Version.init();
- FileInputStream var0 = new FileInputStream(FileDescriptor.in);
- FileOutputStream var1 = new FileOutputStream(FileDescriptor.out);
- FileOutputStream var2 = new FileOutputStream(FileDescriptor.err);
- setIn0(new BufferedInputStream(var0));
- setOut0(new PrintStream(new BufferedOutputStream(var1, 128), true));
- setErr0(new PrintStream(new BufferedOutputStream(var2, 128), true));
- loadLibrary("zip");
- Terminator.setup();
- Shutdown.add(SharedSecrets.getJavaIOAccess().consoleRestoreHook());
- Shutdown.add(ApplicationShutdownHooks.hook());
- Shutdown.add(SharedSecrets.getJavaIODeleteOnExitAccess());
- VM.initializeOSEnvironment();
- VM.maxDirectMemory();
- VM.allowArraySyntax();
- VM.booted();
- Thread var3 = Thread.currentThread();
- var3.getThreadGroup().add(var3);
- SharedSecrets.setJavaLangAccess(new 2());
- }
-
- static Class getCallerClass() {
- return Reflection.getCallerClass(3);
- }
-
- static {
- registerNatives();
- field_0 = nullInputStream();
- out = nullPrintStream();
- err = nullPrintStream();
- security = null;
- cons = null;
- }
- }
-